<template>
	<div>
		<el-card class="box-card" shadow="never" style="height: 80px; width: 100%;">
			<el-form :inline="true" :model="user">
				<el-button type="primary" @click="addRow()">添加新用户</el-button>
				<el-button type="success" @click="findByCondition()" plain>查询</el-button>
				<el-button type="warning" @click="user={}" plain>清空</el-button>
		
				<el-form-item label="用户ID:" label-width="70px">
					<el-input v-model="user.userId" filterable style="width: 130px" placeholder="请输入业主Id"></el-input>
				</el-form-item>
				<el-form-item label="账号:" label-width="70px">
					<el-input v-model="user.userName" filterable style="width: 130px" placeholder="请输入业主Id"></el-input>
				</el-form-item>
				<el-form-item label="密码:" label-width="70px">
					<el-input v-model="user.userpassword" filterable style="width: 130px"
						placeholder="请输入密码" show-password></el-input>
				</el-form-item>
				<el-form-item label="状态:" label-width="70px">
					<el-input v-model="user.userStatus" filterable style="width: 130px" placeholder="请输入业主Id"></el-input>
				</el-form-item>
				<el-form-item label="姓名:" label-width="70px">
					<el-input v-model="user.name" filterable style="width: 130px" placeholder="请输入业主Id"></el-input>
				</el-form-item>
				<el-form-item label="身份证:" label-width="70px">
					<el-input v-model="user.idCard" filterable style="width: 130px" placeholder="请输入业主Id"></el-input>
				</el-form-item>
				<el-form-item label="车辆状态:" label-width="75px">
					<el-select v-model="user.carStatus" placeholder="请选择" style="width: 100px">
						<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
						</el-option>
					</el-select>
				</el-form-item>
			</el-form>
		</el-card><br>
		
		
		<el-table :data="users" border>
			<el-table-column prop="userId" label="用户ID" align="center">
			</el-table-column>
			<el-table-column prop="userName" label="账号" align="center">
			</el-table-column>
			<el-table-column prop="userStatus" label="状态" align="center">
			</el-table-column>
			<el-table-column prop="name" label="姓名" align="center">
			</el-table-column>
			<el-table-column prop="idCard" label="身份证" align="center">
			</el-table-column>

			<el-table-column label="操作" align="center">
				<template slot-scope="scope">
					<el-button @click="updateRow(scope)" type="primary" plain>更改</el-button>
					<el-popconfirm confirm-button-text='删除' cancel-button-text='不用了' icon="el-icon-info"
						icon-color="red" title="确定删除吗？" @confirm="deleteRow(scope.$index,scope.row)">
						<el-button slot="reference" type="danger" plain style="margin-left: 0">
							删除
						</el-button>
					</el-popconfirm>
				</template>
			</el-table-column>
		</el-table>
		
	</div>
</template>

<script>
	import axios from "axios"
	export default {
		name: "user",
		data() {
			return {
				users: [],
				user: {}
			}

		},
	}
</script>

<style>
</style>